<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id='root'>
        <!-- <counter v-slot="{item}"><span>{{item}}</span></counter>
        <counter2><button>btn</button></counter2> -->
        <div>loading</div>
        <async-common-item></async-common-item>
        <button @click="changecurrent">切换</button>
    </div>
    <script>
        
        
        let app = Vue.createApp({
            data() {
                return {
                    current:'counter'
                }
            },
            methods:{
                changecurrent(){
                    
                }
            }
        })
        
        const AsyncComonItem = Vue.defineAsyncComponent(()=>{
            return new Promise((reslove, reject)=>{
                setTimeout(() => {
                    reslove({
                        template:`
                            <div>this is a async component</div>
                        `
                    })
                }, 3000);
            })
        })

        app.component('async-common-item', AsyncComonItem)

      

        let vm = app.mount('#root')
    </script>
</body>
</html>